import Vue from "vue";
import Vuex from 'vuex';
import state from './state.js';

Vue.use(Vuex);

export default new Vuex.Store({
    state: {
        city: state.defalutCity
    },
    mutations:{
        changeCityName(state,city){
            state.city = city;
            localStorage.setItem('city',city);
        }
    },
    actions: {
        changeCityName(context,city){
            context.commit('changeCityName',city)
        }
    }
});